<template>
    <div class="prompt" v-show="show">
        {{txt}}
    </div>
</template>

<script>
export default {
    name: 'BasePrompt',
    // props: {
    //     txt: {
    //         type: String,
    //         value: ''
    //     }
    // },
    data() {
        return {
            show: false,
            txt: ''
        }
    },
    methods: {
        showToast() {
            // this.txt = value
            // this.show = true
            setTimeout(() => {
                this.show = false
            }, 2000)
        }
    },
    mounted() {
        this.showToast()
    }
}
</script>

<style lang="postcss" scoped>
    .prompt {
        padding: 8px 8px;
        position: fixed;
        top: 50%;
        left: 0;
        right: 0;
        margin: 0 auto 0;
        transform: translateY(-50%);
        text-align: center;
        width: 100px;
        border-radius: 8px;
        background: rgba(0, 0, 0, 0.438);
        color: rgb(255, 255, 255);
        font-size: 14px;
        /* border: 1px solid rgb(255, 59, 59); */
        z-index: 99999
    }
</style>
